package MOLE.Pay;

import MOLE.*;

/** 
 CnCard ��ժҪ˵����
*/
public class CncardSend
{
	public CncardSend()
	{
		//
		// TODO: �ڴ˴���ӹ��캯���߼�
		//
		//
	}



	public static String GetGotoUrl(String moneyx)
	{

		String oid = MOLE.comm.getRandom();
		int uid = MOLE.GetValue.GetCookieInt("hy_num");
		String uname = MOLE.GetValue.GetCookieValue("hy_name");
		double money = Math.abs(Double.parseDouble(moneyx.trim()));
		String myid = ConfigurationSettings.AppSettings["CaiP_netbank_mid"].toString().trim();
		String key = ConfigurationSettings.AppSettings["CaiP_netbank_md5key"].toString().trim();
		String returnUrl = ConfigurationSettings.AppSettings["CaiP_netbank_url"].toString().trim();
		String ymd = java.time.LocalDateTime.now().toString("yyyyMMdd");

		String md5str = FormsAuthentication.HashPasswordForStoringInConfigFileuniquetempvar.trim().toLowerCase();

//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
			///#region  rwku



//			string sql="select * from bank_charge where oid="+oid.Trim();
//			DataTable d=MOLE.SQL.GetDataTable(sql);
//			if(d.Rows.Count>0)
//			{
//				oid=( Convert.ToInt64(oid)+Convert.ToInt64( MOLE.comm.getRandom(2))).ToString();
//			}


		Order od = new Order();
		od.Oid = Long.parseLong(oid);
		od.money = (java.math.BigDecimal)money;
		od.paytype = "cncard";
		od.Add();

//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
			 ///#endregion


		String gotourl = "https://www.cncard.net/cnpayment/pay/getorder.aspx?" + "c_mid=" + myid + "&c_order=" + oid + "&c_name=" + uname + "&c_address=" + "&c_tel=" + "&c_post=" + "&c_orderamount=" + String.format("%0.2f", money) + "&c_ymd=" + ymd + "&c_moneytype=0" + "&c_retflag=1" + "&c_returl=" + returnUrl + "&c_signstr=" + md5str + "&c_memo1=" + "&c_memo2=" + "&c_paygate=" + "&c_email=" + "&notifytype=" + "&demostatus=" + "&c_language=" + "&c_version=" + "&c_paymenttype=" + "";
		return (gotourl);
		//return;
	}
}